#唐门优测
#道长最帅666
''
"键盘操作"
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
#实例化浏览器驱动
driver = webdriver.Chrome()
driver.maximize_window()
driver.get('http://www.baidu.com')

driver.find_element_by_id('kw').click()
driver.find_element_by_id('kw').send_keys('测试之道')
#删除键
driver.find_element_by_id('kw').send_keys(Keys.BACK_SPACE)
#空格键
driver.find_element_by_id('kw').send_keys(Keys.SPACE)
#制表键tab
driver.find_element_by_id('kw').send_keys(Keys.TAB)
#回车键
driver.find_element_by_id('kw').send_keys(Keys.ENTER)
#全选
driver.find_element_by_id('kw').send_keys(Keys.CONTROL,'a')